/**
 * Created by dev-001 on 2017/2/27.
 * 考察能力
 */
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;

const AbilitySchema = new Schema({
    name: String,
    subject: {
        type: ObjectId,
        ref: 'Subject'
    },
    grade: {
        type: ObjectId,
        ref: 'Grade'//这个年级应该属于系统年级
    },
    createdAt: Date,
    updatedAt: Date
});

AbilitySchema.pre('save', function (next) {
    this.createdAt = new Date();
    next();
});
export default mongoose.model('Ability', AbilitySchema);